<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - mbi.info - /usr/include/c++/4.4.1/bits/list.tcc</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../../index.html">directory</a> - <a href="index.html">usr/include/c++/4.4.1/bits</a> - list.tcc</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>mbi.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-01-23</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">41</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">100.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">41</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // List implementation (out of line) -*- C++ -*-
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
<span class="lineNum">       4 </span>                : // Free Software Foundation, Inc.
<span class="lineNum">       5 </span>                : //
<span class="lineNum">       6 </span>                : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       7 </span>                : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       8 </span>                : // terms of the GNU General Public License as published by the
<span class="lineNum">       9 </span>                : // Free Software Foundation; either version 3, or (at your option)
<span class="lineNum">      10 </span>                : // any later version.
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span>                : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      13 </span>                : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      14 </span>                : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      15 </span>                : // GNU General Public License for more details.
<span class="lineNum">      16 </span>                : 
<span class="lineNum">      17 </span>                : // Under Section 7 of GPL version 3, you are granted additional
<span class="lineNum">      18 </span>                : // permissions described in the GCC Runtime Library Exception, version
<span class="lineNum">      19 </span>                : // 3.1, as published by the Free Software Foundation.
<span class="lineNum">      20 </span>                : 
<span class="lineNum">      21 </span>                : // You should have received a copy of the GNU General Public License and
<span class="lineNum">      22 </span>                : // a copy of the GCC Runtime Library Exception along with this program;
<span class="lineNum">      23 </span>                : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
<span class="lineNum">      24 </span>                : // &lt;http://www.gnu.org/licenses/&gt;.
<span class="lineNum">      25 </span>                : 
<span class="lineNum">      26 </span>                : /*
<span class="lineNum">      27 </span>                :  *
<span class="lineNum">      28 </span>                :  * Copyright (c) 1994
<span class="lineNum">      29 </span>                :  * Hewlett-Packard Company
<span class="lineNum">      30 </span>                :  *
<span class="lineNum">      31 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      32 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      33 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      34 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      35 </span>                :  * in supporting documentation.  Hewlett-Packard Company makes no
<span class="lineNum">      36 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      37 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      38 </span>                :  *
<span class="lineNum">      39 </span>                :  *
<span class="lineNum">      40 </span>                :  * Copyright (c) 1996,1997
<span class="lineNum">      41 </span>                :  * Silicon Graphics Computer Systems, Inc.
<span class="lineNum">      42 </span>                :  *
<span class="lineNum">      43 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      44 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      45 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      46 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      47 </span>                :  * in supporting documentation.  Silicon Graphics makes no
<span class="lineNum">      48 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      49 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      50 </span>                :  */
<span class="lineNum">      51 </span>                : 
<span class="lineNum">      52 </span>                : /** @file list.tcc
<span class="lineNum">      53 </span>                :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      54 </span>                :  *  You should not attempt to use it directly.
<span class="lineNum">      55 </span>                :  */
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                : #ifndef _LIST_TCC
<span class="lineNum">      58 </span>                : #define _LIST_TCC 1
<span class="lineNum">      59 </span>                : 
<span class="lineNum">      60 </span>                : _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
<span class="lineNum">      61 </span>                : 
<span class="lineNum">      62 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">      63 </span>                :     void
<span class="lineNum">      64 </span><span class="lineCov">           2392 :     _List_base&lt;_Tp, _Alloc&gt;::</span>
<span class="lineNum">      65 </span>                :     _M_clear()
<span class="lineNum">      66 </span>                :     {
<span class="lineNum">      67 </span>                :       typedef _List_node&lt;_Tp&gt;  _Node;
<span class="lineNum">      68 </span><span class="lineCov">           2392 :       _Node* __cur = static_cast&lt;_Node*&gt;(this-&gt;_M_impl._M_node._M_next);</span>
<span class="lineNum">      69 </span><span class="lineCov">           4894 :       while (__cur != &amp;this-&gt;_M_impl._M_node)</span>
<span class="lineNum">      70 </span>                :         {
<span class="lineNum">      71 </span><span class="lineCov">            110 :           _Node* __tmp = __cur;</span>
<span class="lineNum">      72 </span><span class="lineCov">            110 :           __cur = static_cast&lt;_Node*&gt;(__cur-&gt;_M_next);</span>
<span class="lineNum">      73 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">      74 </span>                :           _M_get_Node_allocator().destroy(__tmp);
<span class="lineNum">      75 </span>                : #else
<span class="lineNum">      76 </span><span class="lineCov">            110 :           _M_get_Tp_allocator().destroy(&amp;__tmp-&gt;_M_data);</span>
<span class="lineNum">      77 </span>                : #endif
<span class="lineNum">      78 </span><span class="lineCov">            110 :           _M_put_node(__tmp);</span>
<span class="lineNum">      79 </span>                :         }
<span class="lineNum">      80 </span><span class="lineCov">           2392 :     }</span>
<span class="lineNum">      81 </span>                : 
<span class="lineNum">      82 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">      83 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">      84 </span>                :     template&lt;typename... _Args&gt;
<span class="lineNum">      85 </span>                :       typename list&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">      86 </span>                :       list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">      87 </span>                :       emplace(iterator __position, _Args&amp;&amp;... __args)
<span class="lineNum">      88 </span>                :       {
<span class="lineNum">      89 </span>                :         _Node* __tmp = _M_create_node(std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">      90 </span>                :         __tmp-&gt;hook(__position._M_node);
<span class="lineNum">      91 </span>                :         return iterator(__tmp);
<span class="lineNum">      92 </span>                :       }
<span class="lineNum">      93 </span>                : #endif
<span class="lineNum">      94 </span>                : 
<span class="lineNum">      95 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">      96 </span>                :     typename list&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">      97 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">      98 </span>                :     insert(iterator __position, const value_type&amp; __x)
<span class="lineNum">      99 </span>                :     {
<span class="lineNum">     100 </span>                :       _Node* __tmp = _M_create_node(__x);
<span class="lineNum">     101 </span>                :       __tmp-&gt;hook(__position._M_node);
<span class="lineNum">     102 </span>                :       return iterator(__tmp);
<span class="lineNum">     103 </span>                :     }
<span class="lineNum">     104 </span>                : 
<span class="lineNum">     105 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     106 </span>                :     typename list&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">     107 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     108 </span>                :     erase(iterator __position)
<span class="lineNum">     109 </span>                :     {
<span class="lineNum">     110 </span>                :       iterator __ret = iterator(__position._M_node-&gt;_M_next);
<span class="lineNum">     111 </span>                :       _M_erase(__position);
<span class="lineNum">     112 </span>                :       return __ret;
<span class="lineNum">     113 </span>                :     }
<span class="lineNum">     114 </span>                : 
<span class="lineNum">     115 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     116 </span>                :     void
<span class="lineNum">     117 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     118 </span>                :     resize(size_type __new_size, value_type __x)
<span class="lineNum">     119 </span>                :     {
<span class="lineNum">     120 </span>                :       iterator __i = begin();
<span class="lineNum">     121 </span>                :       size_type __len = 0;
<span class="lineNum">     122 </span>                :       for (; __i != end() &amp;&amp; __len &lt; __new_size; ++__i, ++__len)
<span class="lineNum">     123 </span>                :         ;
<span class="lineNum">     124 </span>                :       if (__len == __new_size)
<span class="lineNum">     125 </span>                :         erase(__i, end());
<span class="lineNum">     126 </span>                :       else                          // __i == end()
<span class="lineNum">     127 </span>                :         insert(end(), __new_size - __len, __x);
<span class="lineNum">     128 </span>                :     }
<span class="lineNum">     129 </span>                : 
<span class="lineNum">     130 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     131 </span>                :     list&lt;_Tp, _Alloc&gt;&amp;
<span class="lineNum">     132 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     133 </span>                :     operator=(const list&amp; __x)
<span class="lineNum">     134 </span>                :     {
<span class="lineNum">     135 </span>                :       if (this != &amp;__x)
<span class="lineNum">     136 </span>                :         {
<span class="lineNum">     137 </span>                :           iterator __first1 = begin();
<span class="lineNum">     138 </span>                :           iterator __last1 = end();
<span class="lineNum">     139 </span>                :           const_iterator __first2 = __x.begin();
<span class="lineNum">     140 </span>                :           const_iterator __last2 = __x.end();
<span class="lineNum">     141 </span>                :           for (; __first1 != __last1 &amp;&amp; __first2 != __last2;
<span class="lineNum">     142 </span>                :                ++__first1, ++__first2)
<span class="lineNum">     143 </span>                :             *__first1 = *__first2;
<span class="lineNum">     144 </span>                :           if (__first2 == __last2)
<span class="lineNum">     145 </span>                :             erase(__first1, __last1);
<span class="lineNum">     146 </span>                :           else
<span class="lineNum">     147 </span>                :             insert(__last1, __first2, __last2);
<span class="lineNum">     148 </span>                :         }
<span class="lineNum">     149 </span>                :       return *this;
<span class="lineNum">     150 </span>                :     }
<span class="lineNum">     151 </span>                : 
<span class="lineNum">     152 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     153 </span>                :     void
<span class="lineNum">     154 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     155 </span>                :     _M_fill_assign(size_type __n, const value_type&amp; __val)
<span class="lineNum">     156 </span>                :     {
<span class="lineNum">     157 </span>                :       iterator __i = begin();
<span class="lineNum">     158 </span>                :       for (; __i != end() &amp;&amp; __n &gt; 0; ++__i, --__n)
<span class="lineNum">     159 </span>                :         *__i = __val;
<span class="lineNum">     160 </span>                :       if (__n &gt; 0)
<span class="lineNum">     161 </span>                :         insert(end(), __n, __val);
<span class="lineNum">     162 </span>                :       else
<span class="lineNum">     163 </span>                :         erase(__i, end());
<span class="lineNum">     164 </span>                :     }
<span class="lineNum">     165 </span>                : 
<span class="lineNum">     166 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     167 </span>                :     template &lt;typename _InputIterator&gt;
<span class="lineNum">     168 </span>                :       void
<span class="lineNum">     169 </span>                :       list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     170 </span>                :       _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
<span class="lineNum">     171 </span>                :                          __false_type)
<span class="lineNum">     172 </span>                :       {
<span class="lineNum">     173 </span>                :         iterator __first1 = begin();
<span class="lineNum">     174 </span>                :         iterator __last1 = end();
<span class="lineNum">     175 </span>                :         for (; __first1 != __last1 &amp;&amp; __first2 != __last2;
<span class="lineNum">     176 </span>                :              ++__first1, ++__first2)
<span class="lineNum">     177 </span>                :           *__first1 = *__first2;
<span class="lineNum">     178 </span>                :         if (__first2 == __last2)
<span class="lineNum">     179 </span>                :           erase(__first1, __last1);
<span class="lineNum">     180 </span>                :         else
<span class="lineNum">     181 </span>                :           insert(__last1, __first2, __last2);
<span class="lineNum">     182 </span>                :       }
<span class="lineNum">     183 </span>                : 
<span class="lineNum">     184 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     185 </span>                :     void
<span class="lineNum">     186 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     187 </span>                :     remove(const value_type&amp; __value)
<span class="lineNum">     188 </span>                :     {
<span class="lineNum">     189 </span>                :       iterator __first = begin();
<span class="lineNum">     190 </span>                :       iterator __last = end();
<span class="lineNum">     191 </span>                :       iterator __extra = __last;
<span class="lineNum">     192 </span>                :       while (__first != __last)
<span class="lineNum">     193 </span>                :         {
<span class="lineNum">     194 </span>                :           iterator __next = __first;
<span class="lineNum">     195 </span>                :           ++__next;
<span class="lineNum">     196 </span>                :           if (*__first == __value)
<span class="lineNum">     197 </span>                :             {
<span class="lineNum">     198 </span>                :               // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     199 </span>                :               // 526. Is it undefined if a function in the standard changes
<span class="lineNum">     200 </span>                :               // in parameters?
<span class="lineNum">     201 </span>                :               if (&amp;*__first != &amp;__value)
<span class="lineNum">     202 </span>                :                 _M_erase(__first);
<span class="lineNum">     203 </span>                :               else
<span class="lineNum">     204 </span>                :                 __extra = __first;
<span class="lineNum">     205 </span>                :             }
<span class="lineNum">     206 </span>                :           __first = __next;
<span class="lineNum">     207 </span>                :         }
<span class="lineNum">     208 </span>                :       if (__extra != __last)
<span class="lineNum">     209 </span>                :         _M_erase(__extra);
<span class="lineNum">     210 </span>                :     }
<span class="lineNum">     211 </span>                : 
<span class="lineNum">     212 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     213 </span>                :     void
<span class="lineNum">     214 </span>                :     list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     215 </span>                :     unique()
<span class="lineNum">     216 </span>                :     {
<span class="lineNum">     217 </span>                :       iterator __first = begin();
<span class="lineNum">     218 </span>                :       iterator __last = end();
<span class="lineNum">     219 </span>                :       if (__first == __last)
<span class="lineNum">     220 </span>                :         return;
<span class="lineNum">     221 </span>                :       iterator __next = __first;
<span class="lineNum">     222 </span>                :       while (++__next != __last)
<span class="lineNum">     223 </span>                :         {
<span class="lineNum">     224 </span>                :           if (*__first == *__next)
<span class="lineNum">     225 </span>                :             _M_erase(__next);
<span class="lineNum">     226 </span>                :           else
<span class="lineNum">     227 </span>                :             __first = __next;
<span class="lineNum">     228 </span>                :           __next = __first;
<span class="lineNum">     229 </span>                :         }
<span class="lineNum">     230 </span>                :     }
<span class="lineNum">     231 </span>                : 
<span class="lineNum">     232 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     233 </span>                :     void
<span class="lineNum">     234 </span><span class="lineCov">             72 :     list&lt;_Tp, _Alloc&gt;::</span>
<span class="lineNum">     235 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     236 </span>                :     merge(list&amp;&amp; __x)
<span class="lineNum">     237 </span>                : #else
<span class="lineNum">     238 </span>                :     merge(list&amp; __x)
<span class="lineNum">     239 </span>                : #endif
<span class="lineNum">     240 </span>                :     {
<span class="lineNum">     241 </span>                :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     242 </span>                :       // 300. list::merge() specification incomplete
<span class="lineNum">     243 </span><span class="lineCov">             72 :       if (this != &amp;__x)</span>
<span class="lineNum">     244 </span>                :         {
<span class="lineNum">     245 </span><span class="lineCov">             72 :           _M_check_equal_allocators(__x); </span>
<span class="lineNum">     246 </span>                : 
<span class="lineNum">     247 </span><span class="lineCov">             72 :           iterator __first1 = begin();</span>
<span class="lineNum">     248 </span><span class="lineCov">             72 :           iterator __last1 = end();</span>
<span class="lineNum">     249 </span><span class="lineCov">             72 :           iterator __first2 = __x.begin();</span>
<span class="lineNum">     250 </span><span class="lineCov">             72 :           iterator __last2 = __x.end();</span>
<span class="lineNum">     251 </span><span class="lineCov">            244 :           while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span class="lineNum">     252 </span><span class="lineCov">            100 :             if (*__first2 &lt; *__first1)</span>
<span class="lineNum">     253 </span>                :               {
<span class="lineNum">     254 </span><span class="lineCov">             48 :                 iterator __next = __first2;</span>
<span class="lineNum">     255 </span><span class="lineCov">             48 :                 _M_transfer(__first1, __first2, ++__next);</span>
<span class="lineNum">     256 </span><span class="lineCov">             48 :                 __first2 = __next;</span>
<span class="lineNum">     257 </span>                :               }
<span class="lineNum">     258 </span>                :             else
<span class="lineNum">     259 </span><span class="lineCov">             52 :               ++__first1;</span>
<span class="lineNum">     260 </span><span class="lineCov">             72 :           if (__first2 != __last2)</span>
<span class="lineNum">     261 </span><span class="lineCov">             24 :             _M_transfer(__last1, __first2, __last2);</span>
<span class="lineNum">     262 </span>                :         }
<span class="lineNum">     263 </span><span class="lineCov">             72 :     }</span>
<span class="lineNum">     264 </span>                : 
<span class="lineNum">     265 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     266 </span>                :     template &lt;typename _StrictWeakOrdering&gt;
<span class="lineNum">     267 </span>                :       void
<span class="lineNum">     268 </span>                :       list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     269 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     270 </span>                :       merge(list&amp;&amp; __x, _StrictWeakOrdering __comp)
<span class="lineNum">     271 </span>                : #else
<span class="lineNum">     272 </span>                :       merge(list&amp; __x, _StrictWeakOrdering __comp)
<span class="lineNum">     273 </span>                : #endif
<span class="lineNum">     274 </span>                :       {
<span class="lineNum">     275 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     276 </span>                :         // 300. list::merge() specification incomplete
<span class="lineNum">     277 </span>                :         if (this != &amp;__x)
<span class="lineNum">     278 </span>                :           {
<span class="lineNum">     279 </span>                :             _M_check_equal_allocators(__x);
<span class="lineNum">     280 </span>                : 
<span class="lineNum">     281 </span>                :             iterator __first1 = begin();
<span class="lineNum">     282 </span>                :             iterator __last1 = end();
<span class="lineNum">     283 </span>                :             iterator __first2 = __x.begin();
<span class="lineNum">     284 </span>                :             iterator __last2 = __x.end();
<span class="lineNum">     285 </span>                :             while (__first1 != __last1 &amp;&amp; __first2 != __last2)
<span class="lineNum">     286 </span>                :               if (__comp(*__first2, *__first1))
<span class="lineNum">     287 </span>                :                 {
<span class="lineNum">     288 </span>                :                   iterator __next = __first2;
<span class="lineNum">     289 </span>                :                   _M_transfer(__first1, __first2, ++__next);
<span class="lineNum">     290 </span>                :                   __first2 = __next;
<span class="lineNum">     291 </span>                :                 }
<span class="lineNum">     292 </span>                :               else
<span class="lineNum">     293 </span>                :                 ++__first1;
<span class="lineNum">     294 </span>                :             if (__first2 != __last2)
<span class="lineNum">     295 </span>                :               _M_transfer(__last1, __first2, __last2);
<span class="lineNum">     296 </span>                :           }
<span class="lineNum">     297 </span>                :       }
<span class="lineNum">     298 </span>                : 
<span class="lineNum">     299 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     300 </span>                :     void
<span class="lineNum">     301 </span><span class="lineCov">             36 :     list&lt;_Tp, _Alloc&gt;::</span>
<span class="lineNum">     302 </span>                :     sort()
<span class="lineNum">     303 </span>                :     {
<span class="lineNum">     304 </span>                :       // Do nothing if the list has length 0 or 1.
<span class="lineNum">     305 </span><span class="lineCov">             36 :       if (this-&gt;_M_impl._M_node._M_next != &amp;this-&gt;_M_impl._M_node</span>
<span class="lineNum">     306 </span>                :           &amp;&amp; this-&gt;_M_impl._M_node._M_next-&gt;_M_next != &amp;this-&gt;_M_impl._M_node)
<span class="lineNum">     307 </span>                :       {
<span class="lineNum">     308 </span><span class="lineCov">             36 :         list __carry;</span>
<span class="lineNum">     309 </span><span class="lineCov">             36 :         list __tmp[64];</span>
<span class="lineNum">     310 </span><span class="lineCov">             36 :         list * __fill = &amp;__tmp[0];</span>
<span class="lineNum">     311 </span>                :         list * __counter;
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span><span class="lineCov">            108 :         do</span>
<span class="lineNum">     314 </span>                :           {
<span class="lineNum">     315 </span><span class="lineCov">            108 :             __carry.splice(__carry.begin(), *this, begin());</span>
<span class="lineNum">     316 </span>                : 
<span class="lineNum">     317 </span><span class="lineCov">            144 :             for(__counter = &amp;__tmp[0];</span>
<span class="lineNum">     318 </span>                :                 __counter != __fill &amp;&amp; !__counter-&gt;empty();
<span class="lineNum">     319 </span>                :                 ++__counter)
<span class="lineNum">     320 </span>                :               {
<span class="lineNum">     321 </span><span class="lineCov">             36 :                 __counter-&gt;merge(__carry);</span>
<span class="lineNum">     322 </span><span class="lineCov">             36 :                 __carry.swap(*__counter);</span>
<span class="lineNum">     323 </span>                :               }
<span class="lineNum">     324 </span><span class="lineCov">            108 :             __carry.swap(*__counter);</span>
<span class="lineNum">     325 </span><span class="lineCov">            108 :             if (__counter == __fill)</span>
<span class="lineNum">     326 </span><span class="lineCov">             72 :               ++__fill;</span>
<span class="lineNum">     327 </span>                :           }
<span class="lineNum">     328 </span>                :         while ( !empty() );
<span class="lineNum">     329 </span>                : 
<span class="lineNum">     330 </span><span class="lineCov">             72 :         for (__counter = &amp;__tmp[1]; __counter != __fill; ++__counter)</span>
<span class="lineNum">     331 </span><span class="lineCov">             36 :           __counter-&gt;merge(*(__counter - 1));</span>
<span class="lineNum">     332 </span><span class="lineCov">             36 :         swap( *(__fill - 1) );</span>
<span class="lineNum">     333 </span>                :       }
<span class="lineNum">     334 </span><span class="lineCov">             36 :     }</span>
<span class="lineNum">     335 </span>                : 
<span class="lineNum">     336 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     337 </span>                :     template &lt;typename _Predicate&gt;
<span class="lineNum">     338 </span>                :       void
<span class="lineNum">     339 </span>                :       list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     340 </span>                :       remove_if(_Predicate __pred)
<span class="lineNum">     341 </span>                :       {
<span class="lineNum">     342 </span>                :         iterator __first = begin();
<span class="lineNum">     343 </span>                :         iterator __last = end();
<span class="lineNum">     344 </span>                :         while (__first != __last)
<span class="lineNum">     345 </span>                :           {
<span class="lineNum">     346 </span>                :             iterator __next = __first;
<span class="lineNum">     347 </span>                :             ++__next;
<span class="lineNum">     348 </span>                :             if (__pred(*__first))
<span class="lineNum">     349 </span>                :               _M_erase(__first);
<span class="lineNum">     350 </span>                :             __first = __next;
<span class="lineNum">     351 </span>                :           }
<span class="lineNum">     352 </span>                :       }
<span class="lineNum">     353 </span>                : 
<span class="lineNum">     354 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     355 </span>                :     template &lt;typename _BinaryPredicate&gt;
<span class="lineNum">     356 </span>                :       void
<span class="lineNum">     357 </span>                :       list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     358 </span>                :       unique(_BinaryPredicate __binary_pred)
<span class="lineNum">     359 </span>                :       {
<span class="lineNum">     360 </span>                :         iterator __first = begin();
<span class="lineNum">     361 </span>                :         iterator __last = end();
<span class="lineNum">     362 </span>                :         if (__first == __last)
<span class="lineNum">     363 </span>                :           return;
<span class="lineNum">     364 </span>                :         iterator __next = __first;
<span class="lineNum">     365 </span>                :         while (++__next != __last)
<span class="lineNum">     366 </span>                :           {
<span class="lineNum">     367 </span>                :             if (__binary_pred(*__first, *__next))
<span class="lineNum">     368 </span>                :               _M_erase(__next);
<span class="lineNum">     369 </span>                :             else
<span class="lineNum">     370 </span>                :               __first = __next;
<span class="lineNum">     371 </span>                :             __next = __first;
<span class="lineNum">     372 </span>                :           }
<span class="lineNum">     373 </span>                :       }
<span class="lineNum">     374 </span>                : 
<span class="lineNum">     375 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     376 </span>                :     template &lt;typename _StrictWeakOrdering&gt;
<span class="lineNum">     377 </span>                :       void
<span class="lineNum">     378 </span>                :       list&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     379 </span>                :       sort(_StrictWeakOrdering __comp)
<span class="lineNum">     380 </span>                :       {
<span class="lineNum">     381 </span>                :         // Do nothing if the list has length 0 or 1.
<span class="lineNum">     382 </span>                :         if (this-&gt;_M_impl._M_node._M_next != &amp;this-&gt;_M_impl._M_node
<span class="lineNum">     383 </span>                :             &amp;&amp; this-&gt;_M_impl._M_node._M_next-&gt;_M_next != &amp;this-&gt;_M_impl._M_node)
<span class="lineNum">     384 </span>                :           {
<span class="lineNum">     385 </span>                :             list __carry;
<span class="lineNum">     386 </span>                :             list __tmp[64];
<span class="lineNum">     387 </span>                :             list * __fill = &amp;__tmp[0];
<span class="lineNum">     388 </span>                :             list * __counter;
<span class="lineNum">     389 </span>                : 
<span class="lineNum">     390 </span>                :             do
<span class="lineNum">     391 </span>                :               {
<span class="lineNum">     392 </span>                :                 __carry.splice(__carry.begin(), *this, begin());
<span class="lineNum">     393 </span>                : 
<span class="lineNum">     394 </span>                :                 for(__counter = &amp;__tmp[0];
<span class="lineNum">     395 </span>                :                     __counter != __fill &amp;&amp; !__counter-&gt;empty();
<span class="lineNum">     396 </span>                :                     ++__counter)
<span class="lineNum">     397 </span>                :                   {
<span class="lineNum">     398 </span>                :                     __counter-&gt;merge(__carry, __comp);
<span class="lineNum">     399 </span>                :                     __carry.swap(*__counter);
<span class="lineNum">     400 </span>                :                   }
<span class="lineNum">     401 </span>                :                 __carry.swap(*__counter);
<span class="lineNum">     402 </span>                :                 if (__counter == __fill)
<span class="lineNum">     403 </span>                :                   ++__fill;
<span class="lineNum">     404 </span>                :               }
<span class="lineNum">     405 </span>                :             while ( !empty() );
<span class="lineNum">     406 </span>                : 
<span class="lineNum">     407 </span>                :             for (__counter = &amp;__tmp[1]; __counter != __fill; ++__counter)
<span class="lineNum">     408 </span>                :               __counter-&gt;merge(*(__counter - 1), __comp);
<span class="lineNum">     409 </span>                :             swap(*(__fill - 1));
<span class="lineNum">     410 </span>                :           }
<span class="lineNum">     411 </span>                :       }
<span class="lineNum">     412 </span>                : 
<span class="lineNum">     413 </span>                : _GLIBCXX_END_NESTED_NAMESPACE
<span class="lineNum">     414 </span>                : 
<span class="lineNum">     415 </span>                : #endif /* _LIST_TCC */
<span class="lineNum">     416 </span>                : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
